home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 38
/
Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso
/
-in_the_mag-
/
reader_requests
/
dice_v3.15
/
lib
/
fd
/
fcntl.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-01-26
|
741b
|
43 lines
/*
* FCNTL.C
*
* (c)Copyright 1992-1997 Obvious Implementations Corp. Redistribution and
* use is allowed under the terms of the DICE-LICENSE FILE,
* DICE-LICENSE.TXT.
*/
#include <stdio.h>
#include <stdlib.h>
#include <ioctl.h>
#include <fcntl.h>
#include <errno.h>
int
fcntl(fd, req, arg)
int fd;
int req;
int arg;
{
switch(req) {
case F_DUPFD:
return(ioctl(fd, IOC_DUP, NULL));
case F_GETFD:
arg = -1;
ioctl(fd, IOF_GET|IOC_CEXEC, &arg);
return(arg);
case F_SETFD:
return(ioctl(fd, IOF_SET|IOC_CEXEC, &arg));
case F_GETFL:
arg = -1;
ioctl(fd, IOF_GET|IOC_MODES, &arg);
return(arg);
case F_SETFL:
return(ioctl(fd, IOF_SET|IOC_MODES, &arg));
}
errno = EBADF;
return(-1);
}